from django.db import models

# Create your models here.
from apps.users.models import User


class Artist(models.Model):
    """歌手信息"""
    artist_name = models.CharField(max_length=50, verbose_name='歌手名字')
    artist_id = models.IntegerField(verbose_name='歌手id')
    artist_category = models.CharField(max_length=120, verbose_name='歌手类别')
    artist_pic = models.CharField(max_length=120, verbose_name='歌手图片')


    class Meta:
        db_table = 'tb_Artist'
        verbose_name = '歌手'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.artist_id

class Album(models.Model):
    """专辑信息"""
    album_name = models.CharField(max_length=200, null=True, verbose_name='专辑名字')
    album_id = models.IntegerField(null=True, verbose_name='专辑id')
    album_singer = models.CharField(max_length=50, null=True, verbose_name='专辑歌手')
    album_singer_id = models.IntegerField(null=True, verbose_name='专辑歌手id')
    album_pic = models.CharField(max_length=150, null=True, verbose_name='专辑图片')
    album_time = models.CharField(max_length=120, null=True, verbose_name='专辑时间')
    album_type = models.IntegerField(null=True, verbose_name='专辑类型')

    class Meta:
        db_table = 'tb_Album'
        verbose_name = '专辑'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.album_name


class follow_artist(models.Model):
    """关注的歌手"""

    user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_artist', null=True, verbose_name='用户')
    artist_id = models.CharField(max_length=30, null=True, verbose_name='歌手id')
    artist_name = models.CharField(max_length=30, null=True, verbose_name='歌手名字')
    artist_img = models.CharField(max_length=250, null=True, verbose_name='歌手图片')
    artist_like_count = models.CharField(max_length=30, null=True, verbose_name='歌手关注人数')


    class Meta:
        db_table = 'tb_Follow_artist'
        verbose_name = '关注'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.id
